import { X } from 'x-orm';
import { ProxyUser } from './proxy_user';
import { Member } from './member';

@X.Entity({
    primary : "id"
})
export class ProxyMember{
    id:number;
    nickname:string;
    ip:string;
    ps:string;
    phone : string;
    parent_id : number;

    @X.OneToOne(ProxyMember,ProxyUser,{
        from : (item) => item.parent_id,
        to: item => item.id,
    })
    parent : ProxyUser;

    @X.OneToOne(ProxyMember,Member,{
        from : (item) => item.phone,
        to : item => item.member_name
    })
    member :Member;

    from_jujian : number;
    from_normal : number;
    from_jingji : number;
    from_jigou : number;

    add_time : string;
}